/*
 * Copyright 2016-2016 the original author or authors.
 * Created on 2016/12/22 下午8:23
 */
package cn.com.geasy.config;

import cn.com.geasy.config.RootConfig.WebPackage;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.type.filter.RegexPatternTypeFilter;

import java.util.regex.Pattern;

/**
 * 定义非 Web 相关的 Bean（如运行在应用后台的中间层 Service 和数据层 DAO 组件）的应用上下文
 *
 * @author Mechanic
 * @version 请在此写下该类的版本号
 */
@Configuration
@ComponentScan(basePackages={"cn.com.geasy"},
  excludeFilters={
    @Filter(type= FilterType.CUSTOM, value=WebPackage.class)
  })
public class RootConfig {
    public static class WebPackage extends RegexPatternTypeFilter {
        public WebPackage() {
            super(Pattern.compile("cn\\.com\\.geasy\\.web\\.api"));
        }
    }
}
